package com.servicebuck.database.entity;
// Generated Aug 30, 2011 11:09:02 PM by Hibernate Tools 3.4.0.CR1


import java.util.HashSet;
import java.util.Set;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.JoinTable;
import javax.persistence.ManyToMany;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

/**
 * Reviewrating generated by hbm2java
 */
@Entity
@Table(name="reviewrating"
    ,catalog="telluricng"
)
public class Reviewrating  implements java.io.Serializable {


     private long ratingid;
     private Ratingcategory ratingcategory;
     private String rating;
     private String comments;
     private Set<Reviews> reviewses = new HashSet<Reviews>(0);

    public Reviewrating() {
    }

	
    public Reviewrating(long ratingid, Ratingcategory ratingcategory, String rating) {
        this.ratingid = ratingid;
        this.ratingcategory = ratingcategory;
        this.rating = rating;
    }
    public Reviewrating(long ratingid, Ratingcategory ratingcategory, String rating, String comments, Set<Reviews> reviewses) {
       this.ratingid = ratingid;
       this.ratingcategory = ratingcategory;
       this.rating = rating;
       this.comments = comments;
       this.reviewses = reviewses;
    }
   
     @Id 

    
    @Column(name="ratingid", unique=true, nullable=false)
    public long getRatingid() {
        return this.ratingid;
    }
    
    public void setRatingid(long ratingid) {
        this.ratingid = ratingid;
    }

@ManyToOne(fetch=FetchType.LAZY)
    @JoinColumn(name="ratingtypeid", nullable=false)
    public Ratingcategory getRatingcategory() {
        return this.ratingcategory;
    }
    
    public void setRatingcategory(Ratingcategory ratingcategory) {
        this.ratingcategory = ratingcategory;
    }

    
    @Column(name="rating", nullable=false, length=45)
    public String getRating() {
        return this.rating;
    }
    
    public void setRating(String rating) {
        this.rating = rating;
    }

    
    @Column(name="comments", length=200)
    public String getComments() {
        return this.comments;
    }
    
    public void setComments(String comments) {
        this.comments = comments;
    }

@ManyToMany(fetch=FetchType.LAZY)
    @JoinTable(name="reviewratingbridge", catalog="telluricng", joinColumns = { 
        @JoinColumn(name="ratingid", nullable=false, updatable=false) }, inverseJoinColumns = { 
        @JoinColumn(name="reviewid", nullable=false, updatable=false) })
    public Set<Reviews> getReviewses() {
        return this.reviewses;
    }
    
    public void setReviewses(Set<Reviews> reviewses) {
        this.reviewses = reviewses;
    }




}


